package com.lrkj.back.service.impl;

import java.util.List;
import java.util.Map;

import com.lrkj.back.entity.TbPackageMuban;
import com.lrkj.back.mapper.TbPackageMubanMapper;
import com.lrkj.back.service.TbPackageMubanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.com.cbons.mamisay.parent.db.api.DBInterface;
import cn.com.cbons.mamisay.parent.exception.DBException;
import cn.com.cbons.mamisay.parent.service.base.ParentServiceImpl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

@Transactional
@Service
public class TbPackageMubanServiceImpl extends ParentServiceImpl<TbPackageMuban> implements TbPackageMubanService {
    @Autowired
    private TbPackageMubanMapper mubanmapper;

    @Override
    public PageInfo<TbPackageMuban> findAllPackageMuban(Map<String, Object> map) throws DBException {
        PageHelper.startPage(Integer.valueOf(map.get("pageNo").toString()),
                Integer.valueOf(map.get("pageSize").toString()));
        List<TbPackageMuban> mfList = mubanmapper.findAllPackageList(map);
        PageInfo<TbPackageMuban> page = new PageInfo<>(mfList);
        return page;
    }

    @Override
    public List<TbPackageMuban> findAllPackageNoPageList(Map<String, Object> map) throws DBException {
        List<TbPackageMuban>  list = mubanmapper.findAllPackageList(map);
        return list;
    }

    @Override
    protected DBInterface<TbPackageMuban> getDao() throws DBException {
        return mubanmapper;
    }

    @Override
    public List<TbPackageMuban> findPackage(Map<String, Object> map) {
        return mubanmapper.findPackage(map);
    }

}
